﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DataLib.Common;
using System.Data;
using Microsoft.Reporting.WebForms;
using Ewts.Code;

namespace Ewts.RDLC
{
    public partial class InstorageSelectRDLC : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                InStorageReportView.LocalReport.EnableHyperlinks = true;
            }
        }

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            Search();
        }

        protected void Search()
        {
            string instorageClassify = this.ddlInstorageClassify.SelectedValue;
            string loadnum = this.txtLoadnum.Text;
            string agoCollectCode = this.txtAgoCollectCode.Text;
            string agoCollectLdh = this.txtAgoCollectLdh.Text;
            string barCode = this.txtBarCode.Text;
            string boxid = this.txtBOXID.Text;
            string cum = this.txtcum.Text;
            string dogoodsno = this.txtDoGoodsNo.Text;
            string goodscode = this.txtGoodsCode.Text;
            string position = this.txtPosition.Text;
            string time1 = this.txtTime1.Text;
            string time2 = this.txtTime2.Text;
            string insno = this.insno.Text;
            DataTable dt = new DataLib.BLL.InStorage().getInStorageItem(loadnum, cum, time1, time2, instorageClassify, agoCollectCode, goodscode, agoCollectLdh, insno, position, barCode, boxid, "", "");
  
            ReportDataSource rds = new ReportDataSource("instorageSlcDS", dt);
            InStorageReportView.LocalReport.DataSources.Clear();
            InStorageReportView.LocalReport.DataSources.Add(rds);
            new RDLCPrinter().FillRow(dt, 3, 30, 30);
            InStorageReportView.LocalReport.Refresh();
        }

 
    }
}